﻿using System;
using System.Runtime.InteropServices;

//Should get the audio device volume, haven't been able to test it yet.
namespace Sensors
{
    class Volume
    {
        [DllImport("coredll.dll", EntryPoint = "waveOutGetVolume", SetLastError = true, CharSet = CharSet.Unicode)]
        public static extern int waveOutGetVolume(IntPtr hwo, out uint dwVolume);
        public void getVolume()
        {
            uint vol = 0;
            waveOutGetVolume(IntPtr.Zero, out vol);
            ushort calcvol = (ushort)(vol&0xffff);
            Console.WriteLine(calcvol);
        }
    }
}
